<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="sidebar">
	<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
		<p:growl id="msgs" showDetail="true" />  
  <h:outputText value="View Employee Project Assignments" styleClass="outputTextTitle" />
    <p:dataTable binding="#{employeeProjectAssignmentsBean.dataTable}" id="dataTable" var="project" value="#{employeeProjectAssignmentsBean.projectsList}"  
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">  
   
      
  
        <p:column headerText="Project Name" >  
              <h:outputText value="#{project.projectName}" />    
        </p:column>  
       <p:column headerText="Client Name" >  
         	<h:outputText value="#{project.client}" />  
        </p:column>  
        <p:column headerText="Start Date" >  
             <h:outputText value="#{project.periodFrom}" > 
            <f:convertDateTime pattern="dd/MM/yyyy"/> 
              </h:outputText> 
        </p:column>  
  
        <p:column headerText="End Date" >  
           <h:outputText value="#{project.periodTo}" > 
            <f:convertDateTime pattern="dd/MM/yyyy"/>
            </h:outputText> 
        </p:column>  
        
        <p:column headerText="No of Resources" >  
             <h:outputText value="#{project.noOfResourecs}" />  
        </p:column>  
  
  		<p:column headerText="Status" >  
             <h:outputText value="#{project.status}" />  
        </p:column>  
        
  
        <p:column headerText="Show Details" >  
           
           <p:commandButton id="selectButton" icon="ui-icon-search" title="View" action="#{employeeProjectAssignmentsBean.showEmployeeProjectAssignmentAction}" oncomplete="carDialog.show()"  update="@form">              
          <f:setPropertyActionListener target="#{employeeProjectAssignmentsBean.project}" value="#{project}"></f:setPropertyActionListener>
           </p:commandButton>
           
        </p:column>  
  
    </p:dataTable>  
    
    <p:dialog header="ASSIGNMENT DETAILS" widgetVar="carDialog" resizable="false" id="carDlg" showEffect="fade" hideEffect="explode" modal="true">  
    
  
        <h:panelGrid id="display" columns="3" cellpadding="4" style="margin:0 auto;">  
  
            <f:facet name="header">  
                  
            </f:facet>  
  
            <h:outputText value="Project ID" />  
            <h:outputLabel value=" : " />
            <h:outputText value="#{employeeProjectAssignmentsBean.employeeProject.project.projectId}" style="font-weight:bold"/>  
  
            <h:outputText value="Project Name " />  
            <h:outputLabel value=" : " />
            <h:outputText value="#{employeeProjectAssignmentsBean.employeeProject.project.projectName}" style="font-weight:bold"/>  
  
  
            <h:outputText value="Client Name " />  
            <h:outputLabel value=" : " />
            <h:outputText value="#{employeeProjectAssignmentsBean.employeeProject.project.client}" style="font-weight:bold"/>  
  
            <h:outputText value="Start Date " /> 
            <h:outputLabel value=" : " /> 
            <h:outputText value="#{employeeProjectAssignmentsBean.employeeProject.project.periodFrom}" style="font-weight:bold"> 
            <f:convertDateTime pattern="dd/MM/yyyy"/>
            </h:outputText> 
            
            <h:outputText value="End Date " /> 
            <h:outputLabel value=" : " /> 
            <h:outputText value="#{employeeProjectAssignmentsBean.employeeProject.project.periodTo}" style="font-weight:bold"> 
            <f:convertDateTime pattern="dd/MM/yyyy"/>
            </h:outputText> 
            
            <h:outputText value="No of Resouces  " />  
            <h:outputLabel value=" : " />
            <h:outputText value="#{employeeProjectAssignmentsBean.employeeProject.project.noOfResourecs}" style="font-weight:bold"/>  
  		
  		
  		
       
        </h:panelGrid>  
        <h:panelGrid>
        <p:dataTable binding="#{employeeProjectAssignmentsBean.employeeAssignedProjects}" id="EmployeeAssignedProjects" var="employeeProject" value="#{employeeProjectAssignmentsBean.employeeProjects}"  
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">
  		
         <p:column>  
            <f:facet name="header">  
                    Technology 
            </f:facet>  
            <h:outputText value="#{employeeProject.assignedTechnology}" />  
        </p:column> 
         <p:column>  
            <f:facet name="header">  
                     Employee Name
            </f:facet>  
            <h:outputText value="#{employeeProject.employee.firstName} #{employeeProject.employee.lastName}" />  
        </p:column> 
         <p:column>  
            <f:facet name="header">  
                   Delete Emp
            </f:facet>  
            <p:commandButton value="Delete"  action="#{employeeProjectAssignmentsBean.deleteEmployeeProjectAssignmentAction}" ajax="false" />
            
        </p:column> 
  		 </p:dataTable>
        
        </h:panelGrid>
  
    </p:dialog>  
  
    		
		</h:form>
	</ui:define>
</ui:composition>

